home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / libs / sphigs / sph_dos.lha / dos / srgp / geom.h < prev    next >
Encoding:
Text File  |  1991-11-26  |  1.3 KB  |  34 lines

  1. /**   G E O M E T R I C    A R I T H M E T I C    **/
  2.  
  3. /* Adds two points, returning the result */
  4. srgp__point GEOM_sumOfPoints (srgp__point pt1, srgp__point pt2);
  5.  
  6. /* Computes one of the dimensions of a given rectangle */
  7. int GEOM_widthOfRect (srgp__rectangle r);
  8. int GEOM_heightOfRect (srgp__rectangle r);
  9.  
  10. /* Computes rectangle result of binary operation on two rects */
  11. void GEOM_computeRectUnion (srgp__rectangle r1, srgp__rectangle r2, 
  12.                 srgp__rectangle *result);
  13. int  GEOM_computeRectIntersection (srgp__rectangle r1, srgp__rectangle r2, 
  14.                    srgp__rectangle *result);
  15.         /* RETURNS BOOLEAN: is there a non-null intersection? */
  16.  
  17. /* Returns the rectangle whose center is the same as the center of
  18.  * the given rectangle R and whose dimensions are as given.
  19.  */
  20. srgp__rectangle GEOM_rectWithCommonCenter 
  21.    (srgp__rectangle r, int width, int height);
  22.  
  23. /* Returns the rectangle one of whose diagonals is specified by the
  24.  * two given points.  Rectangles are defined by the SW-NE diagonal.
  25.  * This procedure is useful when the caller "has" a diagonal but
  26.  * knows not which it is.
  27.  */
  28. srgp__rectangle GEOM_rectFromDiagPoints (srgp__point pt1, srgp__point pt2);
  29.  
  30. /* Returns TRUE if and only if the given point is on the boundary of
  31.  * or in the interior of the given rectangle.
  32.  */
  33. int GEOM_ptInRect (srgp__point pt, srgp__rectangle rect);
  34.